<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta name = "format-detection" content = "telephone=no">
    <title>{:getStoreName($_GET['local_id'])}-{$pdetail.name}</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/swiper.min.css">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/goodsDetail.css">
    <script type="text/javascript">
		var yc_share_diy = true;
	</script>
    <include file="Public/common_js"/>
</head>
<body>
<script>
    var isExistDjsTime = false;
</script>
<div class="swiper-container">
    <div class="swiper-wrapper">
        <if condition="empty($phones)">
            <div class="swiper-slide"><img src="__PUBLIC__/Home/images/banner_01.jpg"></div>
            <div class="swiper-slide"><img src="__PUBLIC__/Home/images/banner_01.jpg"></div>
            <else />
            <volist name="phones" id="item">
                <div class="swiper-slide">
                    <if condition="$item['l_url'] neq ''">
                        <img src="{$item['l_url']}">
                     <else/>
                        <img src="/Public/Home/images/blank.png">
                    </if>
                </div>
            </volist>
        </if>

    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
    <!-- todo 倒计时 -->
    <if condition="!empty($flashGoods)">
        <div class="count-down">
            距离结束还有：<span class="hour_show">0</span>:<span class="minute_show">0</span>:<span class="second_show">0</span>
        </div>
        <script>
            isExistDjsTime = true;
            var djs_startTimes = [<?php echo isset($flashGoods['begin_time']) ? ("'".date('Y-m-d H:i:s',$flashGoods['begin_time'])."'"): ''; ?>];
            var djs_endTimes = [<?php echo isset($flashGoods['end_time']) ? ("'".date('Y-m-d H:i:s',$flashGoods['end_time'])."'"): ''; ?>];
        </script>
    </if>
    <!-- 收藏功能 -->
    <div class="goods-collect <if condition='$productLike[like_id]'> active </if>" data-product-id="{$pdetail.product_id}" data-local-id="{$pdetail.local_id}"></div>
</div>
<!-- 商品基本信息 -->
<!--
<div class="goods-basic">
    <h1>{$pdetail.name}</h1>
    <h4>{$pdetail.brief}</h4>
    <div class="bot-box">

        <div class="buy-info">
            <p class="num clearfix">
                <a href="javascript:;" class="minus off">-</a><span class="txt">{$default_num}</span><a href="javascript:;" class="plus on">+</a>
            </p>
            <p class="data">
                &lt;!&ndash;todo 购买数量&ndash;&gt;
                已销售{$pdetail.sales_num}件
            </p>
        </div>
    </div>
    <p class="clearfix"></p>
</div>
-->




<div class="goods-basic">
    <h1>{$pdetail.name}</h1>
    <h4>{$pdetail.spec_info}</h4>
    <div class="bot-box">
        <div class="price-info">


            <if condition="empty($flashGoods)">
                <if condition="empty($proPrice)">
                    <p class="prs"><span class="now-price">{$pdetail.price|number_format=###, 2, '.', ''}</span>
                        <!--<span class="old-price">{$pdetail.marketprice|number_format=###, 2, '.', ''}</span>-->
                    </p>
                 <else/>
                    <p class="prs">
                        <span class="now-price">{$proPrice.price|number_format=###, 2, '.', ''}</span>
                        <if condition="$proPrice.price neq $pdetail.price">
                            <span class="old-price">{$pdetail.price|number_format=###, 2, '.', ''}</span>
                        </if>
                    </p>
                </if>
            <else />
                <p class="prs"><span class="now-price">{$flashGoods.promotion_price|number_format=###, 2, '.', ''}</span></p>
            </if>





            <p class="sps">
                <if condition="!empty($flashGoods)"><label>闪</label></if>
                <if condition="(!empty($proPrice)) and ($proPrice.price neq $pdetail.price)"><label>促销</label></if>
                <volist name="tags" id="tag">
                    <label>{$tag}</label>
                </volist>
            </p>

        </div>
        <div class="buy-mes">
            <p class="data">
                <!--已有6000人购买-->  已销售{$pdetail.sales_num}件
            </p>
        </div>

        <!--<div class="buy-info">
            <p class="num clearfix">
                <a href="javascript:;" class="minus off">-</a><span class="txt">{$default_num}</span><a href="javascript:;" class="plus on">+</a>
            </p>
            <p class="data">
                &lt;!&ndash;todo 购买数量&ndash;&gt;
                已销售{$pdetail.sales_num}件
            </p>
        </div>-->



    </div>
    <p class="clearfix"></p>
</div>



<!-- 商品促销信息 -->
<div class="goods-promotion-info">
    <!--<h4>促销</h4>
    <div class="promotion-label">
        <p><label>立减20.9</label>搭配“札幌農学校特制牛奶饼干12枚...</p>
        <p><label>平安专享</label>搭配“札幌農学校特制牛奶饼干12枚...</p>
        <p><label>15天退货</label>搭配“札幌農学校特制幌農学校特制牛奶饼干12枚...</p>
    </div>-->
    <!--提示说明 -->
    <if condition="$pdetail['explain']">
        <p class="goods-notice">特别说明：{$pdetail['explain']}</p>
    </if>
</div>
<!-- 商品服务 -->
<if condition="count($storeData['services']) gt 0">
    <div class="goods-service">
        <volist name="storeData['services']" id="vo">
            <span>{$vo}</span>
        </volist>
    </div>
</if>
<!-- 店铺名称和联系 -->
<div class="goods-contact mgTop">
    <div class="name"><i></i><a style="color:#232726;" href="{:url('store/index')}">{$storeData.local_name}</a></div>
    <div class="contact"><i></i><a href="tel://{$storeData.tel}">联系商家</a></div>
</div>
<!-- 商品亮点 -->
<!--<div class="goods-merits mgTop">
    <div class="title_01"><span>商品亮点</span></div>
    <div class="merits-content">
        <foreach name="pdetail.highlight" item="vo" >
           <if condition="$vo neq ''"> <p>{$vo}</p> </if>
        </foreach>
    </div>
</div>-->

<!-- 优惠套餐 -->

<if condition="$group_len neq 0">
    <div class="discount mgTop">
        <div class="title_01"><span>优惠套餐</span></div>
        <a href="{:url('goods/groupGoods',array('id'=>$pdetail['store_pid']))}" class="more">共{$group_len}个套餐</a>
        <a href="{:url('goods/groupGoods',array('id'=>$pdetail['store_pid']))}" class="list">
            <?php $k = 0;?>
            <volist name="group_product['list']" id="product" offset="0" length="3">
                <?php if($k > 0){?><label>+</label><?php }?>
                <span>
                    <img class="img-lazyload" src="/Public/Home/images/blank.png" data-original="{$product['goods_id']|getThumb=###}">
                    <i>￥{$product['price']}</i>
                </span>
                <?php $k++;?>
            </volist>
        </a>
        <p class="discount-total">
            <span>立省¥{$group_product['sheng']}</span><label>¥{$group_product['total_price']|number_format=###, 2, '.', ''}</label>
        </p>
    </div>
</if>

<!-- 商品选项卡信息 -->
<div class="goods-tab-details mgTop" style="padding-bottom:1.1rem;">
    <ul class="goods-tab-title">
        <li class="active">商品详情</li>
        <li>评价</li>
        <li>温馨提示</li>
    </ul>
    <div class="goods-tab-content" style="display:block;">
        <!-- 商品规格 -->
        <div class="goods-norms">
            <div class="norms-table">
                <table cellspacing="1" cellpadding="0" width="100%">
                    <volist name="pdetail['goods_property']" id="item" key="key">
                        <if condition="$key !=1">
                            <tr>
                                <td><strong>{$key}</strong></td>
                                <td>{$item}</td>
                            </tr>
                        </if>
                    </volist>
                </table>
            </div>
        </div>
        <!-- 商品详情 -->
        <div class="goods-detail mgTop">
            <div id="detail-content-ajax" class="detail-content slideContent">
                正在加载内容...
            </div>
        </div>
    </div>
    <div class="goods-tab-content">
        <!-- 商品评价 -->
        <div class="goods-comment">
            <p class="total-score">
                <span>综合评分<label>{$comments.info.grade|default=5}</label></span>
                <span>好评率<label>{$comments.info.good_comment|floatToPercent=###}</label></span>
                <span>{$comments.totalnum|default=0}条评价</span>
            </p>
            <if condition="count($comments['list']) gt 0">
                <volist name="comments['list']" id="item">
                    <div class="goods-comment-item">
                        <h4><span><img src="{$item.logo|default='/Public/Home/images/userPic.png'}" alt=""><label>{$item.nickname|default='无名'}</label></span><span>{$item.create_time}</span></h4>
                        <p>{$item.content}</p>
                    </div>
                </volist>
                <else />
                <div class="goods-comment-item">
                    <p>暂无评论</p>
                </div>
            </if>
            <if condition="$comments['totalnum'] gt 12">
                <div class="comment-more"><a href="{:url('home/goods/getMoreComment',['id'=>$id])}">查看更多></a></div>
            </if>
        </div>
    </div>
    <div class="goods-tab-content">
        <!-- 温馨提示 -->
        <div class="remind">
            <div class="remind-content">
                <!--<p>使用时间：2016.7.13-2016.8.1；</p>
                <p>营业时间：11:00-24:00；</p>
                <p>本产品支持随时退款；</p>
                <p>如需开具发票，请具体咨询客服；</p>
                <p>如有疑问，请联系怡臣客服。</p>-->
                <p><?php  echo html_entity_decode($storeData['wenxintishi'], ENT_QUOTES, 'UTF-8');?></p>
                <!--<p class="service-tel"><a href="javascript:void(0);">联系客服</a></p>-->
            </div>
        </div>
    </div>
</div>


<div class="fixed-bot-cart">
    <p class="add-cart">
        <a href="{:url('home/carts/cart')}">
            <span id="unique-cart-number" class="cart-number">{$cnum.num}</span>
            <label class="add_number">+1</label></a>
    </p>
    <if condition="!empty($flashGoods)">

        <if condition="$flashGoods['initnum'] eq 0">
            <div class="buy-info">
            <p class="sold-out-state"><a class="btn btn-primary btn-block">商品售罄</a></p>
            </div>
            <else />
                <div class="buy-info">
                    <div class="ajax_goodsId" style="display: none" data-carturl="{:u('home/carts/addcart')}" data-glist="{$plist['spec_num']}" data-glist_total="{$plist['spec_num_total']}" data-sid="{$pdetail.local_id}"  data-pid="{$pdetail.product_id}"  data-url="{:u('home/carts/isStore')}" data-gid="{$pdetail.goods_id}" data-spid="{$pdetail.store_pid}"></div>

                    <if condition="$plist['spec_num'] eq 1 And $plist['spec_num_total'] gt 1" >
                        <p class="sold-out-state"><a class="btn btn-default btn-block add-goods">加入购物车</a></p>
                        <else/>
                        <p class="num clearfix">
                            <a href="javascript:;" class="minus off">-</a><span class="txt" id="number">{$default_num}</span><a href="javascript:;" class="plus on add-goods" data-pid="{$pdetail.product_id}">+</a>
                        </p>
                    </if>
                    
                </div>
        </if>

        <else />

        <if condition="$plist[0]['enStore'] eq 0">
            <div class="buy-info">
            <p class="sold-out-state"><a class="btn btn-primary btn-block">商品售罄</a></p>
            </div>
            <else />
            <div class="buy-info">
                <div class="ajax_goodsId" style="display: none" data-carturl="{:u('home/carts/addcart')}" data-glist="{$plist['spec_num']}" data-glist_total="{$plist['spec_num_total']}" data-sid="{$pdetail.local_id}"  data-pid="{$pdetail.product_id}"  data-url="{:u('home/carts/isStore')}" data-gid="{$pdetail.goods_id}" data-spid="{$pdetail.store_pid}"></div>

                <if condition="$plist['spec_num'] eq 1 And $plist['spec_num_total'] gt 1" >
                    <p class="sold-out-state"><a class="btn btn-default btn-block add-goods">加入购物车</a></p>
                    <else/>
                    <p class="num clearfix">
                        <a href="javascript:;" class="minus off">-</a><span class="txt" id="number">{$default_num}</span><a href="javascript:;" class="plus on add-goods" data-pid="{$pdetail.product_id}">+</a>
                    </p>
                </if>

            </div>
        </if>

    </if>

</div>

<div class="goods-norms-popup">
    <h3><if condition="$plist['spec_num'] neq 0 And $plist['spec_num_total'] gt 1" >请选择参数/规格/购买数量</if><a href="javascript:void(0);" class="close spec_info_close">×</a></h3>

    <if condition="$plist['spec_num'] eq 1 And $plist['spec_num_total'] gt 1"  >

        <ul class="gg-goods-list">
            <volist name="plist" id="item" key="k">
                <if condition="$item.spec_info neq NULL ">
                    <li <if condition="$item.enStore eq 0 ">class="out-stock"<else />
                    <eq name="item.product_id" value="$pdetail.product_id">class="active"</eq>
                </if> >
                <span class="tit">{$item.spec_info}
                <if condition="$item.msg neq NULL "> <label class="isProductsg">{$item.msg}</label></if>
                </span>
                    <span class="price">￥{$item.price|number_format=###, 2, '.', ''}</span>

                    <if condition="!empty($flashGoods)">

                        <if condition="$flashGoods['initnum'] eq 0">
                            <span class="status">售罄</span>
                            <else />
                            <p class="operate">
                                <a href="javascript:;" class="minus off">-</a><span class="txt">0</span><a href="javascript:;" class="plus on" data-pid="{$item['product_id']}">+</a>
                            </p>
                        </if>


                        <else />
                        <if condition="$item['enStore'] eq 0">
                            <span class="status">售罄</span>
                            <else />
                            <p class="operate">
<a href="javascript:;" class="minus off">-</a><span class="txt">{$item['gDetail_Cart_num']}</span><a href="javascript:;" class="plus on" data-pid="{$item['product_id']}">+</a>
                            </p>
                        </if>
                    </if>


                    </li>

                </if>
            </volist>
        </ul>
    </if>
    <div class="cart-check-area">
        <a>
            <i class="cart"></i>
            <span id="gg-cart-buy-num" class="cart-number num">{$cnum.num}</span>
            <label class="add_number">+1</label>
        </a>
        <a href="{:url('Carts/cart')}"><i class="cart"></i></a>
        <p class="tip">
            <span class="price" id="only-price">￥{$CartMoney}</span>
            <span class="sp-info">{$storeData['maxPriceDesc']}</span>
        </p>
    </div>
</div>
<!-- 提示弹窗 -->
<div class="alert-popup">
    <p>是否允许拨打客服电话{$storeData.tel}</p>
    <p><a href="javascript:void(0);" class="cancel">取消</a><a href="javascript:void(0);" class="confirm">允许</a></p>
</div>
<!-- 优惠卷兑换 -->
<div class="coupon-btn"><span>兑换</span></div>
<!-- 兑换流程 -->
<div class="coupon-redeem-box" style="display: none">
    <span class="close"></span>
    <div class="redeem-state">
        <div class="red-inputInfo">
            <h1>礼券兑换</h1>
            <input type="text" placeholder="请输入你的兑换码" id="cdKey"> 
            <a id="cup_btn" href="javascript:void(0);">兑换</a>               
        </div>
        <p class="red-code-tips clearfix">请输入你的兑换码！</p>
        <div class="cup-success" style="display:none;">  
            <span></span>
            <p>您可在个人中心查看，该窗口<i>3</i>秒后自动关闭</p>              
        </div>
    </div>
</div>

<include file="Public/bind_phone"/>
<include file ="Public/subclass_menu"/>
<script type="text/javascript">
    var _good_id = "<?php echo $_GET["id"]; ?>";
    require(['goodsDetail','subClassMain']);	
</script>
</body>
</html>


